<template>
  <div>
    <h1>我是父组件 --- {{money}}</h1>
    <Son :money="money" @changeMoney="fatherFn" v-model:car="car"></Son>
  </div>
</template>

<script>
import { ref } from 'vue'
import Son from './components/Son.vue'
export default {
  components: {
    Son
  },
  setup () {
    //钱
    const money = ref(100)
    const fatherFn = (newMoney) => {
      console.log(newMoney)
      money.value = newMoney
    }

    // 车
    const car = ref('劳斯莱斯 幻影')
    return {
      money,
      car,
      fatherFn
    }
  }
}
</script>

<style>

</style>
